package concurrency.chapter1;

import java.util.HashMap;

/**
 * @author honway.liu
 * @date 2019-06-03 22:26
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
public class ServiceWindow extends Thread {
    private static final int MAX = 50;

    private final String name;

    private static int index = 1;

    public ServiceWindow(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        while (index < MAX) {
            HashMap<Object, Object> map = new HashMap<>();
            map.size();
            System.out.println("当前柜台:" + name + ",叫号:" + (index++) + "号.");
        }
    }
}
